<template>
	<view class='live_box'>
		<view class="live_list" v-if="shulist.length>0">
			<view class="live_item" v-for="(item,index) in shulist" :key='index' @click="navShop(index,item.id)">
				<view class="left">
					<avatar :img='item.headimgurl' :size="44"></avatar>
					<view class="vertical">
						<view class="name">{{item.user_name}}</view>
					</view>
				</view>
				<view class="follow" v-if="item.is_shield == 1" @click="jiechu(item.to_uid,index)">解除拉黑</view>
				<view v-else class="isfollow" @click="lahei(item.to_uid,index)">拉黑</view>
			</view>
		</view>
		<view class="" v-else>
			<image src="@/static/shuju.png" mode="" style="width: 440upx;height: 320upx;margin-left: 150upx;margin-top: 150upx;"></image>
		</view>	
	</view>
</template>
<script>
	import avatar from '../../components/avatar.vue'
	export default {
		name: 'homeSon',
		data() {
			return {
				list: [],
				clickLoading: false,
				countNum: 0,
				isShow: true,
				isshow: 1,
				typeNum: 1,
				shulist: [],
				page: 1,
				is_la: 1
			}
		},
		components: {
			avatar
		},

		onShow() {

		},
		onLoad(option) {
			if (option.type) {
				this.isshow = Number(option.type)
			} else {
				this.isshow = 1
			}
			this.$http.backlist().then(res => {
				console.log("我看看奥", res.data)
				this.shulist = res.data
			})


		},
		methods: {
			lahei(to_uid,index) {
				this.$http.laback({
					to_uid,
					is_shield: 0
				}).then(res => {
					console.log(res, "举报")
					if (res.status == 200) {
						uni.showToast({
							title: res.mess
						})
						this.shulist[index].is_shield = 1
					} else {
						uni.showToast({
							title: res.mess,
							icon: 'none'
						})
					}
				})
			},
			jiechu(to_uid,index) {
				this.$http.laback({
					to_uid,
					is_shield: 1,
				}).then(res => {
					console.log(res, "举报")
					if (res.status == 200) {
						uni.showToast({
							title: res.mess
						})
						this.shulist[index].is_shield = 0
					} else {
						uni.showToast({
							title: res.mess,
							icon: 'none'
						})
					}
				})
			},
			getd() {
				this.isshow = 2
				this.$http.userfollowlist({
					type: this.isshow,
					page: this.page
				}).then(res => {
					console.log("我看看奥", res)
					this.shulist = res.data.list
					this.shunum = res.data.count
				})
			},



		}
	}
</script>
<style lang="less">
	.gg {
		font-size: 32upx;
		color: #FFFFFF;
	}

	.ggw {
		font-size: 32upx;
		color: #FF3D3D;
		font-weight: bold;
	}

	.live_box {
		background-color: #0F111D;
		// padding-top: 80rpx;
		// margin-top: 70upx;
		height: 100vh;

		.live_list {
			height: calc(100vh - 400rpx);
		}

		.none_box {
			width: 100vw;
			height: 30vh;
			line-height: 30vh;
			text-align: center;
			color: #fff;
			font-size: 40rpx;
		}

		.live_item {
			width: 94vw;
			margin: 0rpx 3vw;
			padding-top: 15rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.left {
				display: flex;
				align-items: center;
			}

			.vertical {
				display: flex;
				flex-direction: column;
				height: 88rpx;
				justify-content: space-around;
				margin-left: 15rpx;

				.name {
					font-size: 30rpx;
					color: #ffffff;
				}

				.is_status {
					font-size: 24rpx;
					color: #ffffff;
				}
			}

			.follow {
				width: 140rpx;
				height: 60rpx;
				background-color: #3a3a44;
				border-radius: 5rpx;
				line-height: 60rpx;
				font-size: 30rpx;
				color: #ffffff;
				text-align: center;
			}

			.no_follow {
				width: 120rpx;
				height: 60rpx;
				background-color: #ff3d3d;
				border-radius: 5rpx;
				line-height: 60rpx;
				font-size: 30rpx;
				color: #ffffff;
				text-align: center;
			}

		}

		.isfollow {
			width: 140rpx;
			height: 60rpx;
			background-color: #ff3d3d;
			border-radius: 5rpx;
			line-height: 60rpx;
			font-size: 30rpx;
			color: #ffffff;
			text-align: center;
		}

		.live_num_box {
			position: fixed;
			width: 94vw;
			left: 3vw;
			bottom: 108rpx;
			height: 150rpx;
			line-height: 150rpx;
			// background: red;
			color: #999999;
			z-index: 99;
			text-align: center;
			border-top: 1px solid #333;
		}
	}
</style>
